home *** CD-ROM | disk | FTP | other *** search
/ Amiga Inside! / Amiga FD Inside (1995)(Ultramax).iso / berndspd / devtools / precognition / src / library / valuator.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-12  |  1.7 KB  |  88 lines

  1. /* ==========================================================================
  2. **
  3. **                   Valuator.c
  4. **
  5. ** ©1991 WILLISoft
  6. **
  7. ** ==========================================================================
  8. */
  9.  
  10. #include "Valuator.h"
  11. #include "ValuatorClass.h"
  12. #ifndef __GNUC__
  13. #include <clib/exec_protos.h>
  14. #include <clib/intuition_protos.h>
  15. #include <clib/graphics_protos.h>
  16. #endif
  17. #ifdef __GNUC__
  18. #include <proto/exec.h>
  19. #include <proto/intuition.h>
  20. #include <proto/graphics.h>
  21. #endif
  22. #ifdef __SASC
  23. #include <proto/exec.h>
  24. #include <proto/intuition.h>
  25. #include <proto/graphics.h>
  26. #endif
  27. #include "amigamem.h"
  28.  
  29.  
  30. LONG Value( Valuator *self )
  31. {
  32.    struct ValuatorClass *class;
  33.  
  34.  
  35.    if( class = (struct ValuatorClass *)self->isa )
  36.    {
  37.       if (class->Value)
  38.          return (*class->Value)( self );
  39.    }
  40.    else
  41.       return 0;
  42. }
  43.  
  44. LONG SetValue( Valuator *self, LONG selection )
  45. {
  46.    struct ValuatorClass *class;
  47.  
  48.  
  49.    if( class = (struct ValuatorClass *)self->isa )
  50.    {
  51.       if( class->SetValue )
  52.          return (*class->SetValue)( self, selection );
  53.    }
  54.    else
  55.       return 0;
  56. }
  57.  
  58.  
  59.  
  60. BOOL Valuator_elaborated = FALSE;
  61.  
  62. struct ValuatorClass Valuator_Class;
  63.  
  64. void ValuatorClass_Init( struct ValuatorClass *class )
  65. {
  66.    InteractorClass_Init( (struct InteractorClass *) class );
  67.    class->isa          = InteractorClass();
  68.    class->ClassName    = "Valuator";
  69.    class->Value        = NULL;
  70.    class->SetValue     = NULL;
  71. }
  72.  
  73.  
  74. struct ValuatorClass *ValuatorClass( void )
  75. {
  76.    if( ! Valuator_elaborated )
  77.    {
  78.       ValuatorClass_Init( &Valuator_Class );
  79.       Valuator_elaborated = TRUE;
  80.    }
  81.  
  82.    return &Valuator_Class;
  83. }
  84.  
  85. void Valuator_Init( Valuator *self )
  86. {
  87.    Interactor_Init( self );
  88. }